{% extends "pos/base.html" %} {% load static %} {% block title %}Sale Approval Validator{% endblock %} {% block heading %}Sale Approval Validator{% endblock %} {% block stylesheets %} {% endblock %} {% block content %}

Sale Approval Validator

Staging dry run ya live approved sale validation check karein.

Run Validator
Staging Dry Run mein staging invoice no dein. Live Sale Validate mein live invoice no dein.
{% if result %}
Mode {{ result.type }}
Status {% if result.ok %} OK {% else %} Issue {% endif %}
Invoice {% if result.staging_invoice_no %} #{{ result.staging_invoice_no }} {% else %} #{{ result.live_invoice_no }} {% endif %}
{% if result.summary %}
Issues {{ result.summary.issues_count }}
{% endif %}
Validator Message
{% if result.ok %}
{{ result.message }}
{% else %}
{{ result.message }}
{% endif %}
{% if result.settings %}
Stock Settings
Zero Stock Allow {{ result.settings.zero_stock_allow }} Check Batch {{ result.settings.check_batch }}
Expiry Warn Days {{ result.settings.expiry_warn_days }} Partial Sale On Stock Short {{ result.settings.partial_sale_on_stock_short }}
{% endif %} {% if result.type == "staging_dry_run" %}
Staging Dry Run Lines
{% for line in result.lines %} {% empty %} {% endfor %}
Product Requested Approved Short Status Issues
{{ line.product_name|default:"Product" }}
Code: {{ line.product_code }}
Staging Line ID: {{ line.staging_line_id }}
Qty: {{ line.requested_qty|floatformat:2 }}
Bonus: {{ line.requested_bonus|floatformat:2 }}
Qty: {{ line.approved_qty|floatformat:2 }}
Bonus: {{ line.approved_bonus|floatformat:2 }}
Qty: {{ line.short_qty|floatformat:2 }}
Bonus: {{ line.short_bonus|floatformat:2 }}
{% if line.skip %} Skipped {% elif line.is_partial %} Partial {% else %} Full {% endif %} {% for issue in line.issues %}
{{ issue.code }}
{{ issue.message }}
{% empty %} - {% endfor %}
Expected Allocations / Batch Layers {% for a in line.allocations %} {% empty %} {% endfor %}
Line UID Stock ID Variant ID Variant Product ID Default? Qty Take Bonus Take Expected Stock History
{{ a.line_uid }} {{ a.stock_id }} {{ a.variant_id }} {{ a.variant_product_id }} {{ a.variant_is_default }} {{ a.qty_take|floatformat:2 }} {{ a.bonus_take|floatformat:2 }} Changed: {{ a.expected_stock_history.changed_stock|floatformat:2 }}
Bonus: {{ a.expected_stock_history.bonus_stock|floatformat:2 }}
Variant: {{ a.expected_stock_history.variant_id }}
No allocation found.
No dry run lines found.
{% endif %} {% if result.type == "live_sale_validation" %}
Live Sale Validation Summary
Sale Lines {{ result.summary.sale_lines }} Stock History Rows {{ result.summary.stock_history_rows }} Issues {{ result.summary.issues_count }}
Live Sale Lines vs Stock History
{% for line in result.lines %} {% empty %} {% endfor %}
Sale Line Product Line UID Sale Qty/Bonus History Qty/Bonus Sale Variant History Variant Status Issues
#{{ line.sale_line_id }} Product Code: {{ line.product_code }}
History Item: {{ line.history_item_id }}
{{ line.line_uid }} Qty: {{ line.sale_qty|floatformat:2 }}
Bonus: {{ line.sale_bonus|floatformat:2 }}
Qty: {{ line.history_qty_part|floatformat:2 }}
Bonus: {{ line.history_bonus|floatformat:2 }}
{{ line.sale_variant_id|default:"NULL" }} {{ line.history_variant_id|default:"NULL" }} {% if line.ok %} OK {% else %} Issue {% endif %} {% for issue in line.issues %}
{{ issue.code }}
{{ issue.message }}
{% empty %} - {% endfor %}
No live sale lines found.
Orphan Stock History Rows
{% for h in result.orphan_stock_history %} {% empty %} {% endfor %}
Stock History ID Line UID Item ID Variant ID Changed Stock Bonus Stock Message
#{{ h.stock_history_id }} {{ h.line_uid }} {{ h.item_id }} {{ h.variant_id|default:"NULL" }} {{ h.changed_stock }} {{ h.bonus_stock }} {{ h.message }}
No orphan stock history row.
{% endif %}
All Issues
{% for issue in result.issues %} {% empty %} {% endfor %}
Code Line UID Sale Line Stock History Message
{{ issue.code }} {{ issue.line_uid|default:"-" }} {{ issue.sale_line_id|default:"-" }} {{ issue.stock_history_id|default:"-" }} {{ issue.message }}
No issue found.
{% endif %}
{% endblock %}